#pragma once

#include <QWidget>
#include "ui_CairoSurface.h"

#include <cairo/cairo.h>

class QImage;

class CairoSurface : public QWidget
{
	Q_OBJECT

public:
	CairoSurface(QWidget *parent = nullptr);
	~CairoSurface();

protected:
	virtual void paintEvent(QPaintEvent* event)override;

private:
	Ui::CairoSurfaceClass ui;

	cairo_surface_t* _surface = nullptr;
	cairo_t* _context = nullptr;

	QImage* _img = nullptr;
};
